export const imgerror = {
  // 当指令绑定的元素插入父元素的时候就会触发
  // el: 指令绑定的元素  binding: 参数对象
  inserted(el, binding) {
    // console.log(el, binding.value, '1111111111111')
    // 当img标签加载图片失败
    el.onerror = function() {
      el.src = binding.value
    }
  }
  // bind(el, binding) {
  //   console.log(el, binding.value, '2222222222222')
  // }
}

export const color = {
  inserted(el, binding) {
    el.style.color = binding.value
  }
}
